<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>窗口标题Title</title>
    <style type="text/css">
        a, button {
            margin: 5px;
        }

        .title, .select {
            background: #C4E3FD;
            width: 100%;
            height: 35px;
            position: fixed;
            top: 0;
        }

        .select {
            background: #ffffff;
            top: 35px;
            display: flex;
        }

        .select .inps {
            flex: 1;
        }

        .select .inpQuery {
            width: 50px;
        }
    </style>
</head>
<body id="bodyId" style="border: 0; padding: 0;margin:0;overflow-x: hidden;overflow-y: hidden;height: 900px;">
<div class="title" style="-webkit-app-region: drag;width: 100%;border: 1px solid red;text-align: right;">
    <span>这里是 div 自定义窗口标题栏 可以拖动窗口</span>
    <button onclick="minWindow()" style="-webkit-app-region:no-drag">最小化</button>
    <button onclick="maxWindow()" style="-webkit-app-region:no-drag">最大化</button>
    <button onclick="closeWindow()" style="-webkit-app-region:no-drag">关闭</button>
</div>
<div class="select">
    <button class="inpQuery" style="transform: rotate(180deg)" id="back">▶</button>
    <button class="inpQuery" id="forward">▶</button>
    <button class="inpQuery" id="refresh">↻✖</button>
    <input class="inps" type="text" placeholder="地址栏">
    <button class="inpQuery">GO</button>
</div>
<div style="margin-top: 70px;overflow-y: auto;height: 850px;overflow-x: hidden;">
    <h3>开发时测试的各种使用方式的集合示例</h3>
    <div style="-webkit-app-region: drag;border: 1px solid red;width: 600px;background-color: #C4E3FD;color: black;font-family: 'Microsoft YaHei UI';">
        这个区域是可拖拽的,
        自定义窗口标题栏(支持:Windows、MacOSX、Linux)<br>LCL(windows,MacOS), WF(Windows、Linux), MacOS(onmousedown="divMnmousedown(event)")
    </div>
    <p>Golang 绑定映射 Javascript 通用类型属性、函数，结构对象属性</p>
    通用类型：

    <button onclick="windowList()">获取window-List</button>
    <button onclick="testGetVal()">循环测试</button>
    <button onclick="clearIntervalFn()">clearInterval</button>
    <br>
    <button onclick="GetVar()">GetVar</button>
    <button onclick="extFunName()">Go对象extFunName函数</button>
    <button onclick="SetVarA(-1)">SetVar</button>
    <button onclick="SetVarA(0)">VarSetString</button>
    <button onclick="SetVarA(1)">VarSetInt</button>
    <button onclick="SetVarA(2)">VarSetDouble</button>
    <button onclick="SetVarA(3)">VarSetBool</button>
    <br>
    <button onclick="myFunc()">执行函数</button>
    <button onclick="newWindow()">创建新窗口</button>
    <button onclick="newBrowserWindow()">创建Browser新窗口</button>
    <button onclick="goCallJsCode()">在GO中调用JS代码</button>
    <br>
    对象固定类型
    <button onclick="getObjectFieldValue()">Object-获取字段值</button>
    <button onclick="asyncIPCGetObjectFieldValue()">异步IPC-获取对象值</button>
    <button onclick="asyncIPCSetObjectFieldValue()">异步IPC-设置对象值</button>
    <button onclick="setObjectFieldValue()">Object-设置字段值</button>
    <button onclick="setObjectFieldValue1()">Object-设置字段值1</button>
    <button onclick="objectFunc()">Object-执行函数</button>
    <br>
    <button onclick="asyncIPCGet()">异步IPC-获取值</button>
    <button onclick="GetValue()">获取值</button>
    <br>
    <input id="find" value="">
    <button onclick="find()">查找</button>
    <button onclick="findStop()">停止查找</button>
    <br>
    <script>
        function ZoomPct() {
            ipc.emit("ZoomPct");
        }
        function ZoomLevel() {
            ipc.emit("ZoomLevel");
        }
        function SetZoomStep() {
            ipc.emit("SetZoomStep");
        }
    </script>
    Chromium其它
    <button onclick="ZoomPct()">ZoomPct</button>
    <button onclick="ZoomLevel()">ZoomLevel</button>
    <button onclick="SetZoomStep()">SetZoomStep</button>
    <br>
    UI操作
    <button onclick="disabledUIBtn()">禁用【打印PDF】按钮</button>
    <button onclick="ipcServerOn()">IPC Server ON测试</button>
    <button onclick="subWindowIPCOn()">子窗口IPCOn事件(jsrender > gobrowser > gorender > gobrowser)</button>
    <br>
    <button onclick="BrowserId()">BrowserWindow.BrowserId()</button>
    <button onclick="FrameId()">BrowserWindow.FrameId()</button>
    <a target="_blank" href="demo-misc.html">新窗口</a>
    <a href="demo-misc.html">当前窗口</a>
    <a href="https://www.baidu.com">百度</a>
    <a target="_blank" href="https://note.yanghy.cn">Note(新窗口)</a>
    <a href="https://note.yanghy.cn">Note</a>
    <a href="min-browser-refresh.html">自动刷新</a>
    <a href="http://nn.gxajks.com/default/loaddown">下载页面</a>
    <a href="https://www.360cities.net/">https://www.360cities.net/</a>
    <a href="https://playground.babylonjs.com/">https://playground.babylonjs.com/</a>
    <a href="http://120.48.25.102:8089/">http://120.48.25.102:8089/</a>
    <div id="test" style="width: 100%;border: solid 1px red;min-height: 100px;"></div>
    <br>
    <!--    <iframe id="aaaaa" name="aaaaa" src="demo-misc.html" width="49%" height="300"></iframe>-->
    <!--    <iframe id="bbbbb" name="bbbbb"  src="demo-misc.html" width="49%" height="300"></iframe>-->
    <textarea style="width: 100%;height: 200px;"></textarea>
    <br>
    <img src="icon.ico">
    <br>
    视频播放：
    <video id="my_video_1" class="video-js vjs-default-skin" width="300px" height="300px"
           controls preload="none" poster='http://video-js.zencoder.com/oceans-clip.jpg'
           data-setup='{ "aspectRatio":"640:267", "playbackRates": [1, 1.5, 2] }' onmouseenter="">
        <source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'/>
        <source src="https://vjs.zencdn.net/v/oceans.webm" type='video/webm'/>
        <source src="https://cdn.letv-cdn.com/2018/12/05/JOCeEEUuoteFrjCg/playlist.m3u8" type='application/x-mpegURL'/>
    </video>
    <video width="400" controls>
        <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
        <source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
        Your browser does not support HTML video.
    </video>
    <script>
        var a = 0;

        function newWindow() {
            ipc.emit("js-new-window");
        }

        //监听一个js函数，在Go中调用，带有参数和返回值
        ipc.on("js-ipc-on", function (val, doubleValue) {
            alert("js-ipc-on 执行了 参数: " + val + "  doubleValue: " + doubleValue);
            return "返回值";
        });

        //定义一个函数，在Go中调用，带有参数, 返回值GO中接收不到
        function jsCode(val) {
            alert("jsCode 执行了: " + val);
        }

        function goCallJsCode() {
            //这个示例通过 ipc触发go的代码，然后在go中调用js
            //在go中执行js调用 jsCode() 函数
            ipc.emit("go-call-js-code");
        }

        function newBrowserWindow() {
            ipc.emit("js-new-browser-window");
        }

        function find() {
            ipc.emit("find", [document.getElementById('find').value]);
        }

        function findStop() {
            ipc.emit("find-stop");
        }

        function BrowserId() {
            test(browserWindow.browserId());
        }

        function FrameId() {
            test(browserWindow.frameId());
        }

        function minWindow() {
            ipc.emit("minWindow");
        }

        function maxWindow() {
            ipc.emit("maxWindow");
        }

        function closeWindow() {
            ipc.emit("closeWindow");
        }

        function divMnmousedown(e) {
            windowDrag.mousedown(e.clientX, e.clientY);
            document.onmousemove = function (e) {
                e.preventDefault()
                windowDrag.mousemove(e.clientX, e.clientY);
            }
            document.onmouseup = function () {
                windowDrag.mouseup();
                document.onmousemove = null;
                document.onmouseup = null;
            };
        }

        function subWindowIPCOn() {
            ipc.emit("subWindowIPCOn", ["参数值"], function (ret) {
                test("subWindowIPCOn", ret);
            });
        }

        //地址栏
        ipc.on("OnLoadingStateChange", function (isLoading, canGoBack, canGoForward) {
            test("OnLoadingStateChange", isLoading, canGoBack, canGoForward);
        })
        ipc.on("OnLoadingProgressChange", function (progress) {
            test("OnLoadingProgressChange", progress);
        })
        ipc.on("window-resize", function (x, y, w, h) {
            document.getElementById("test").innerHTML = "";
            test("window-resize", x, y, w, h);
        });


        //js 注册监听一些事件
        ipc.on("ondalert", function () {
            // alert("onalert执行了");
        })
        ipc.on("onDemoRetString", function (v1, v2, v3, v4) {
            document.getElementById("test").innerHTML = "";
            test("onDemoRetString", v1, v2, v3, v4);
            return "onDemoRetString 我是结果";
        })
        ipc.on("onDemoRetInt", function (v1, v2, v3, v4) {
            test("onDemoRetInt", v1, v2, v3, v4);
            return 110;
        })
        ipc.on("onDemoRetDouble", function (v1, v2, v3, v4) {
            test("onDemoRetDouble", v1, v2, v3, v4);
            return 110.120;
        })
        ipc.on("onDemoRetBoolean", function (v1, v2, v3, v4) {
            test("onDemoRetBoolean", v1, v2, v3, v4);
            return true;
        })
        ipc.on("ondemo", function (v1, v2, v3, v4) {
            test("ondemo", v1, v2, v3, v4);
            return "ondemo 我是结果";
        })
        ipc.on("ondemo1", function (v1, v2, v3, v4) {
            test("ondemo1", v1, v2, v3, v4);
            return "ondemo1 我是结果";
        })
        ipc.on("ondemo2", function (v1, v2, v3, v4) {
            test("ondemo2", v1, v2, v3, v4);
            return "ondemo2 我是结果";
        })
        var retIdx = 0;
        ipc.on("ondemo3", function (v1, v2, v3, v4) {
            test("ondemo3", v1, v2, v3, v4)
            retIdx++;
            return "ondemo3 我是结果" + v1 + v2 + v3 + v4 + "  " + retIdx;
        })
        ipc.on("ondemo4", function (v1, v2, v3, v4) {
            test("ondemo4", v1, v2, v3, v4)
            return document.getElementById("bodyId").innerHTML.replaceAll("\n", "");
        })

        function extFunName() {
            try {
                goobj.ObjDemo.noExtFunName(11);
                test("未导出这里不会执行");
            } catch (e) {
                test("未导出函数 ExtFunName ", e)
            }
            try {
                goobj.ObjDemo.ExtFunName(11);
                test("导出函数  ExtFunName ok");
            } catch (e) {
                test("导出函数", e)
            }
        }


        function disabledUIBtn() {
            //goobj.ObjDemo.DisabledUIBtn();
            ipc.emit("goobj.ObjDemo.DisabledUIBtn", function (value, success) {
                document.getElementById("test").innerHTML = "";
                test("goobj.ObjDemo.DisabledUIBtn:", value, "success:", success)
            });
        }

        function GetValue() {
            document.getElementById("test").innerHTML = "获取值<br>";
            test(goobj.ObjDemo.ObjFnParams(1, "string", 555.44, true))
            test("NameField-value:", goobj.ObjDemo.NameField)
            test("ObjDemoFloat64Field-value:", goobj.ObjDemo.ObjDemoFloat64Field)
            test("ObjDemoIntField-value:", goobj.ObjDemo.ObjDemoIntField)
            test("ObjDemoBoolField-value:", goobj.ObjDemo.ObjDemoBoolField)
            test("ObjFn1-value:", window.goobj.ObjDemo.ObjFn1(1111))
            test("ObjDemo-value:", JSON.stringify(window.goobj.ObjDemo))
            test("stringv-value:", v8obj.stringv);
            test("integerv-value:", v8obj.integerv);
            test("doublev-value:", v8obj.doublev);
            test("booleanv-value:", v8obj.booleanv);
            // test("普通对象:", JSON.stringify(v8obj))
            test("结构对象:", JSON.stringify(goobj))
        }

        function asyncIPCGet() {
            for (let i = 0; i < 1; i++) {
                asyncIPCGetFor();
            }
        }

        function asyncIPCGetFor() {
            document.getElementById("test").innerHTML = "异步IPC-获取值<br>";
            try {
                var ii = 0;
                var begin = new Date().getTime()
                ipc.emit("goobj.ObjDemo.ObjFnParams", [1, "string", 555.44, true], function (value) {
                    test("ObjFnParams-Ret-value:", value)
                });
                ipc.emit("goobj.ObjDemo.NameField", function (value) {
                    test("NameField-value:", value)
                });
                ipc.emit("goobj.ObjDemo.NameField", [3333], function (value, is) {
                    test("NameField-value:", value, is)
                });
                ipc.emit("goobj.ObjDemo.ObjDemoFloat64Field", function (value) {
                    test("ObjDemoFloat64Field-value:", value)
                });
                ipc.emit("goobj.ObjDemo.ObjDemoIntField", function (value) {
                    test("ObjDemoIntField-value:", value)
                });
                ipc.emit("goobj.ObjDemo.ObjDemoBoolField", function (value) {
                    test("ObjDemoBoolField-value:", value)
                });
                ipc.emit("window.goobj.ObjDemo.ObjFn1", [1111], function (value) {
                    test("ObjFn1-value:", value)
                });
                ipc.emit("window.goobj.ObjDemo", function (value) {
                    test("ObjDemo-value:", JSON.stringify(value))
                });
                ipc.emit("goobj.ObjDemo.ObjDemoIntField", [88888]);
                ipc.emit("goobj.ObjDemo.ObjDemoIntField", [666666]);
                ipc.emit("goobj.ObjDemo.ObjDemoIntField", [555555]);
                test("stringv-value:", v8obj.stringv);
                test("integerv-value:", v8obj.integerv);
                test("doublev-value:", v8obj.doublev);
                test("booleanv-value:", v8obj.booleanv);
                ipc.emit("window.v8obj.stringv", function (value) {
                    test("ipc-stringv-value:", value)
                });
                ipc.emit("window.v8obj.integerv", function (value) {
                    test("ipc-integerv-value:", value)
                });
                ipc.emit("window.v8obj.doublev", function (value) {
                    test("ipc-doublev-value:", value)
                });
                ipc.emit("window.v8obj.booleanv", function (value) {
                    test("ipc-booleanv-value:", value)
                });
                ipc.emit("subWindowIPCOn", ["参数值"], function (ret) {
                    test("subWindowIPCOn", ret);
                });
                ipc.emit("v8obj", function (value) {
                    //这里会变成同步 stringify
                    var str = JSON.stringify(value);
                    test("普通对象:", str)
                });
                ipc.emit("window.goobj", function (value) {
                    var str = JSON.stringify(value);
                    test("结构对象:", str)
                });

                //window.goobj.ObjDemo.CallbackCount();
                test("用时:", (new Date().getTime() - begin) / 1000, " ii:", ii);
            } catch (e) {
                test(e)
            }
        }

        function ipcServerOn() {
            document.getElementById("test").innerHTML = "";
            try {
                //自定义 go ipc on
                ipc.emit("test", [110, "字符串"], function (value) {
                    test("test:", value)
                })
            } catch (e) {
                test(e)
            }
        }

        function objectFunc() {
            try {
                document.getElementById("test").innerHTML = "执行对象函数<br>";
                window.goobj.ObjDemo.CallbackCount();
                test(window.goobj.ObjDemo.ObjFn1(1123));
                window.goobj.ObjDemo.ObjFnNoOut(6966);
                test(window.goobj.ObjDemo.SubObjDemoField.SubObjFn1(1123));
            } catch (e) {
                test(e)
            }
        }

        function setObjectFieldValue() {
            document.getElementById("test").innerHTML = "";
            try {
                window.goobj.ObjDemo.NameField = "NameFieldNameFieldNameField==setObjectFieldValue";
                goobj.ObjDemo.SubObjDemoField.NameField = "（Js setObjectFieldValue 赋的值）";
                window.goobj.ObjDemo.SubObjDemoField.SubString = "window.goobj.ObjDemo.SubObjDemoField.SubString";
                window.goobj.ObjDemo.SubObjDemoField.SubBool = false;
                window.goobj.ObjDemo.ObjDemoStringField = "我是个字符串的值"
                window.goobj.ObjDemo.ObjDemoBoolField = true;
                goobj.ObjDemo.ObjDemoIntField = 11111;
                test("设置成功")
            } catch (e) {
                test(e)
            }
            try {
                window.goobj.ObjDemo = "改变一下";
            } catch (e) {
                test(e)
            }
        }

        function setObjectFieldValue1() {
            document.getElementById("test").innerHTML = "";
            try {
                goobj.ObjDemo.SubObjDemoField.NameField = "（Js setObjectFieldValue1 赋的值）";
                window.goobj.ObjDemo.NameField = "window.goobj.ObjDemo.NameField==setObjectFieldValue1";
                window.goobj.ObjDemo.SubObjDemoField.SubString = "杨老杨window.goobj.ObjDemo.SubObjDemoField.SubString";
                window.goobj.ObjDemo.SubObjDemoField.SubBool = true;
                window.goobj.ObjDemo.ObjDemoStringField = "window.goobj.ObjDemo.ObjDemoStringField我是个字符串的值"
                window.goobj.ObjDemo.ObjDemoBoolField = false;
                goobj.ObjDemo.ObjDemoIntField = 9999999;
                test("设置成功")
            } catch (e) {
                test(e)
            }
        }

        function asyncIPCSetObjectFieldValue() {
            document.getElementById("test").innerHTML = "";
            try {
                ipc.emit("goobj.ObjDemo.NameField", function (value) {
                    test("goobj.ObjDemo.NameField:", value)
                });
                ipc.emit("goobj.ObjDemo.NameField", ['IPC设置值'], function (value) {
                    test("goobj.ObjDemo.NameField:", value)
                    test("goobj.ObjDemo.NameField:", goobj.ObjDemo.NameField)
                    goobj.ObjDemo.NameField = "ABCD";
                    test("goobj.ObjDemo.NameField:", goobj.ObjDemo.NameField)
                });
            } catch (e) {
                test(e)
            }
        }

        function asyncIPCGetObjectFieldValue() {
            document.getElementById("test").innerHTML = "";
            try {
                ipc.emit("goobj.ObjDemo.NameField", function (value) {
                    test("goobj.ObjDemo.NameField:", value)
                });
                ipc.emit("goobj.ObjDemo.SubObjDemoField.SubString", function (value) {
                    test("goobj.ObjDemo.SubObjDemoField.SubString:", value)
                });
                ipc.emit("window.goobj.ObjDemo.SubObjDemoField.SubBool", function (value) {
                    test("window.goobj.ObjDemo.SubObjDemoField.SubBool:", value)
                });
                ipc.emit("window.goobj.ObjDemo.ObjDemoStringField", function (value) {
                    test("window.goobj.ObjDemo.ObjDemoStringField:", value)
                });
                ipc.emit("window.goobj.ObjDemo.ObjDemoBoolField", function (value) {
                    test("window.goobj.ObjDemo.ObjDemoBoolField:", value)
                });
                ipc.emit("goobj.ObjDemo.ObjDemoIntField", function (value) {
                    test("goobj.ObjDemo.ObjDemoIntField:", value)
                });
            } catch (e) {
                test(e)
            }
        }

        function getObjectFieldValue() {
            document.getElementById("test").innerHTML = "";
            var start = new Date().getTime();
            try {
                // test("goobj.ObjDemo.NameField:", goobj.ObjDemo.NameField)
                // var ssss = window.goobj.ObjDemo.SubObjDemoField;
                // test("window.goobj.ObjDemo.SubObjDemoField.NameField:", window.goobj.ObjDemo.SubObjDemoField.NameField)
                // test("goobj.ObjDemo.SubObjDemoField.SubString:", window.goobj.ObjDemo.SubObjDemoField.SubString)
                // test("goobj.ObjDemo.SubObjDemoField.SubBool:", window.goobj.ObjDemo.SubObjDemoField.SubBool)
                // test("goobj.ObjDemo.ObjDemoStringField:", window.goobj.ObjDemo.ObjDemoStringField)
                test("goobj.ObjDemo.ObjDemoBoolField:", window.goobj.ObjDemo.ObjDemoBoolField)
                test("goobj.ObjDemo:", JSON.stringify(window.goobj.ObjDemo))
                // test("对象变量ssss取值:", ssss.SubString);
                // test("ObjDemo.SubObjDemoField子象转JSON:", JSON.stringify(window.goobj.ObjDemo.SubObjDemoField.SubSubObjDemoField))
                // test("对象转JSON:", JSON.stringify(window.goobj.ObjDemo))
            } catch (e) {
                test(e)
            }
            var end = new Date().getTime() - start;
            test("用时", end / 1000, "秒")
        }

        var doc = document.getElementById("test");

        function test(...vvv) {
            var str = doc.innerHTML;
            for (var i = 0; i < vvv.length; i++) {
                str = str + "  " + vvv[i];
            }
            str += "<br>";
            doc.innerHTML = str;
        }

        function windowList() {
            ipc.emit('window-list', function (list) {
                document.getElementById("test").innerHTML = "";
                test(list)
            });
        }

        function myFunc() {
            document.getElementById("test").innerHTML = "执行函数<br>";
            try {
                var res = v8obj.myfuncHHg("我是myfunc的第一个参数 " + a, "false1false1" + a);
                test("myfuncHHg-res: " + res + " 入参 我是myfunc的第一个参数 false1false1 " + a);
                res = v8obj.myfuncaHHg("我是myfunc1的第一个参数", 121 + a);
                test("myfuncaHHg-res: " + res + " 入参 我是myfunc1的第一个参数, 121");
                res = v8obj.myfuncbHHg("我是myfunc2的第一个参数", 333.1 + a, 4444.3333 + a, 999999 + a);
                test("myfuncbHHg-res: " + res + " 入参 我是myfunc2的第一个参数 333.1, 999999");
                res = v8obj.myfunccHHg("我是myfunc3的第一个参数" + a, true);
                test("myfunccHHg-res: " + res + " 入参 我是myfunc3的第一个参数, true");
            } catch (e) {
                test(e)
            }
        }

        var interval = 0

        function testGetVal() {
            if (interval > 0) {
                return
            }
            interval = setInterval(function () {
                doc.innerHTML = "";
                SetVarA(a % 1)
                GetVar()
                ipc.emit("goobj.ObjDemo.SubObjDemoFiel.NameField", ['新值'], function (value, success, errorCode) {
                    test("不存在的字段, success:", success, "value:", value, 'errorCode:', errorCode)
                });
                subWindowIPCOn()
                // //不存在的字段将返回错误
                ipc.emit("goobj.ObjDemo.SubObjDemoField.NameFiel", ['新值'], function (value, success, errorCode) {
                    test("不存在的字段, success:", success, "value:", value, 'errorCode:', errorCode)
                    SetVarA(a % 2)
                    GetVar()
                });
                ipc.emit("goobj.ObjDemo.SubObjDemoField.NameField", function (value, success, errorCode) {
                    test("存在的字段取值, success:", success, "value:", value, 'errorCode:', errorCode)
                    GetVar()
                });
                ipc.emit("goobj.ObjDemo.SubObjDemoField.NameField", [false], function (value, success, errorCode) {
                    test("不一样的类型, success:", success, "value:", value, 'errorCode:', errorCode)
                });
                var newValue = a + '字符串';
                ipc.emit("goobj.ObjDemo.SubObjDemoField.NameField", [newValue], function (value, success, errorCode) {
                    test("存在的字段赋值, success:", success, 'errorCode:', errorCode, "oldValue:", value, "newValue:", newValue)
                    SetVarA(a % 3)
                    GetVar()
                });
                //对象类型不会赋值,而是返回这个对象
                ipc.emit("goobj.ObjDemo.SubObjDemoField", ['新值'], function (value, success, errorCode) {
                    test("对象赋值, success:", success, 'errorCode:', errorCode, "value:", JSON.stringify(value))
                    subWindowIPCOn()
                });
                // test('------------------------------------------------------------------------------------------------------------')
                SetVarA(a % 2)
                GetVar();
                SetVarA(a % 3)
                GetVar();
                // goobj.ObjDemo.SubObjDemoField.NameField = 'bbbb ' + a;
                // test('直接取值, 存在的字段', goobj.ObjDemo.SubObjDemoField.NameField);
                // test('------------------------------------------------------------------------------------------------------------')
                //asyncIPCGet();
                a++
            }, 10);
        }

        function clearIntervalFn() {
            clearInterval(interval)
            interval = 0;
        }

        function GetVar() {
            try {
                document.getElementById("test").innerHTML = "";
                test('stringv:', window.v8obj.stringv);
                test('integerv:', window.v8obj.integerv);
                test('doublev:', window.v8obj.doublev);
                test('booleanv:', window.v8obj.booleanv);
                test('nullv:', window.v8obj.nullv);
                test('undefinedv:', window.v8obj.undefinedv);
            } catch (e) {
                test(e)
            }
        }

        function SetVarA(t) {
            try {
                if (t === 0) {
                    window.v8obj.stringv = "stringv我是字符串" + a;
                    window.v8obj.integerv = "integerv我是字符串" + a;
                    window.v8obj.doublev = "doublev我是字符串" + a;
                    window.v8obj.booleanv = "booleanv我是字符串" + a;
                } else if (t === 1) {
                    window.v8obj.stringv = 111111 + a;
                    window.v8obj.integerv = 222222 + a;
                    window.v8obj.doublev = 33333 + a;
                    window.v8obj.booleanv = 44444 + a;
                } else if (t === 2) {
                    window.v8obj.stringv = 111111.11111 + a;
                    window.v8obj.integerv = 222222.22222 + a;
                    window.v8obj.doublev = 33333.33333 + a;
                    window.v8obj.booleanv = 44444.44444 + a;
                } else if (t === 3) {
                    window.v8obj.stringv = false;
                    window.v8obj.integerv = true;
                    window.v8obj.doublev = false;
                    window.v8obj.booleanv = true;
                } else {
                    window.v8obj.stringv = "stringv"
                    window.v8obj.integerv = 3333;
                    window.v8obj.doublev = "我本来是double";
                    window.v8obj.booleanv = false;
                }
            } catch (e) {
                test(e)
            }
        }


    </script>
</div>
</body>
</html>